package labelsystem.config;/**
 * @projectName careOlder
 * @Description TODO
 * @author MCG
 * @time 2023/3/28 15:06
 */

import com.google.common.base.Predicates;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import java.io.File;

/**
 *description: TODO
 *@author MCG
 *@date 2023/3/28 15:06
 *@Version 1.0
 */
@Configuration
public class webConfig extends WebMvcConfigurerAdapter {


    @Value("C:/Users/niemengzun/Desktop/test/check/")
    private String checkfilePath;
    @Value("C:/Users/niemengzun/Desktop/test/doctorPhoto/")
    private String doctorPhotofilePath;

    @Value("C:/Users/niemengzun/Desktop/test/dCertificate/")
    private String dCertificate;
    @Value("C:/Users/niemengzun/Desktop/test/vCertificate/")
    private String vCertificate;
    @Value("C:/Users/niemengzun/Desktop/test/text/")
    private String textPath;
    @Value("C:/Users/niemengzun/Desktop/test/video/")
    private String videoPath;
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        //上传的图片在D盘下的image目录下，访问路径如：http://localhost:8082/image/100942.jpg
        //其中image表示访问的前缀。"file:D:/image/"是文件真实的存储路径
        registry.addResourceHandler("/doctorPhoto/**").addResourceLocations("file:"+ doctorPhotofilePath);
        registry.addResourceHandler("/doctorCert/**").addResourceLocations("file:"+dCertificate);
        registry.addResourceHandler("/VolunteerCert/**").addResourceLocations("file:"+vCertificate);
        registry.addResourceHandler("/text/**").addResourceLocations("file:"+textPath);
        registry.addResourceHandler("/video/**").addResourceLocations("file:"+videoPath);
        registry.addResourceHandler("/check/**").addResourceLocations("file:"+checkfilePath);

    }



}
